#define _CRT_SECURE_NO_WARNINGS 1

#include"string.h"

int main()
{
	zy::string s1("aello world");
	cout << s1 << endl;
	cin >> s1;
	cout << s1 << endl;
	getline(cin, s1);
	cout << s1 << endl;

	/*zy::string s1;
	std::string s2;
	cout << sizeof(s1) << endl;
	cout << sizeof(s2) << endl;*/
	

	/*zy::string s1("aello world");
	zy::string s2("hello world");
	cout << (s1 == s2) << endl;
	cout << (s1 != s2) << endl;
	cout << (s1 > s2) << endl;
	cout << (s1 >= s2) << endl;
	cout << (s1 < s2) << endl;
	cout << (s1 <= s2) << endl;*/

	/*zy::string s1("hello world");
	cout << (s1.substr(4, 3)).c_str() << endl;
	cout << (s1.substr(2, 15)).c_str() << endl;
	cout << (s1.substr()).c_str() << endl;*/

	/*zy::string s1("hello world");
	cout << s1.find('w') << endl;
	cout << s1.find("rl") << endl;*/

	/*zy::string s1("hello world");
	zy::string s2("hhh");
	zy::string s3(s1);
	s3 += "111";
	cout << s3.c_str() << endl;
	s1 = s2;
	s1 += 'c';
	cout << s1.c_str() << endl;*/


	/*zy::string s1("hello world");
	zy::string s2("xxx");
	s1.swap(s2);
	cout << s1.c_str() << endl;
	cout << s2.c_str() << endl;*/

	/*zy::string s1("hello world");
	s1.erase(7, -1);
	cout << s1.c_str() << endl;
	s1.erase();
	cout << s1.c_str() << endl;*/

	/*zy::string s1("hello world");
	s1.insert(s1.size(), "aa");
	s1.insert(4, "bb");
	s1.insert(0, "cc");
	cout << s1.c_str() << endl;*/

	/*zy::string s1("hello world");
	s1.insert(s1.size(), 'a');
	s1.insert(4, 'b');
	s1.insert(0, 'c');
	cout << s1.c_str() << endl; */


	/*zy::string s1;
	s1 += 'c';
	s1 += "xxx";
	cout << s1.c_str() << endl;*/

	/*zy::string s1;
	s1.push_back('a');
	s1.push_back('b');
	s1.push_back('c');
	s1.append("xxxx");
	cout << s1.c_str() << endl;
	cout << s1.size() << "-" << s1.capacity() << endl;*/

	/*zy::string s1;
	s1.resize(8);
	cout << s1.c_str() << endl;
	cout << s1.size() << "-" << s1.capacity() << endl;

	s1.resize(10, 'a');
	cout << s1.c_str() << endl;
	cout << s1.size() << "-" << s1.capacity() << endl;

	s1.resize(20, 'b');
	cout << s1.c_str() << endl;
	cout << s1.size() << "-" << s1.capacity() << endl;*/

	/*std::string s1("hello world");
	std::string::reverse_iterator rit = s1.rbegin();
	while (rit != s1.rend())
	{
		cout << *rit;
		rit++;
	}*/

	//const zy::string s1("hello world");
	//zy::string::const_iterator it = s1.begin();
	//while (it != s1.end())
	//{
	//	cout << *it;
	//	/*++* it;
	//	cout << *it;*/
	//	it++;
	//}

	/*for (int i = 0; i < s1.size(); i++)
	{
		cout << s1[i];
	}*/

	/*zy::string s1("hello world");
	zy::string s2(s1);
	cout << s2.c_str() << endl;
	cout << s1.c_str() << endl;*/

	return 0;
}
